<template>
  <a-modal v-model:visible="visibleSmallModal1[key]" :title="`企业类型标准(${props.smallModalId1})`" :footer="null" style="top: 20px; text-align: center" @ok="handleOk()">
    <a-descriptions bordered>
      <a-descriptions-item label="标准编号" :span="3"> {{ dataTable.standardId }}</a-descriptions-item>
      <a-descriptions-item label="中文名称" :span="3">{{ dataTable.standardName }}</a-descriptions-item>
      <a-descriptions-item label="英文名称" :span="3">{{ dataTable.standardEnglish }}</a-descriptions-item>
      <a-descriptions-item label="标准说明" :span="3">{{ dataTable.standardMsg }}</a-descriptions-item>
      <a-descriptions-item label="来源机构" :span="3"> {{ dataTable.standardSource }}</a-descriptions-item>
      <a-descriptions-item label="是否可为空" :span="3">{{ nullData }}</a-descriptions-item>
      <a-descriptions-item label="数据类型" :span="3">{{ typeData }}</a-descriptions-item>
      <a-descriptions-item label="枚举范围" :span="3">企业类型码表({{ dataTable.standardId }})-「4.12:点击跳转码表详情</a-descriptions-item>
      <a-descriptions-item label="默认值" :span="3"> {{ dataTable.standardDefault }}</a-descriptions-item>
    </a-descriptions>
  </a-modal>
</template>
<script setup lang="ts">
  import { ref, Ref } from 'vue';
  const props = defineProps({
    dataTable: {
      type: Object,
      default: () => {
        return [];
      },
    },
    visibleIdModal: {
      type: Array,
      default: () => {
        return [];
      },
    },
    smallModalId1: {
      type: String,
    },
    keys: {
      type: String,
    },
  });
  let typeData = ref('');
  let nullData = ref('');
  //类型转换
  if (props.dataTable.standardDataType == 1) {
    typeData.value = 'String';
  } else if (props.dataTable.standardDataType == 2) {
    typeData.value = 'Float';
  } else if (props.dataTable.standardDataType == 3) {
    typeData.value = 'Int';
  } else if (props.dataTable.standardDataType == 4) {
    typeData.value = 'Enum';
  }
  //是否可为空转换
  if (props.dataTable.standardIsNull == 1) {
    nullData.value = '不可为空';
  } else if (props.dataTable.standardIsNull == 2) {
    nullData.value = '可为空';
  }
  console.log('.22..', typeData.value);
  console.log('.11..', nullData.value);

  let key: Ref<number> = ref(999);
  const emit = defineEmits(['changeShow']);
  const visibleSmallModal1: Ref<boolean[]> = ref([]);
  const handleOk = () => {
    visibleSmallModal1.value[key.value] = false;
    emit('changeShow', 'false');
  };
</script>
